<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/js/jquery-3.1.1.min.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<title></title>
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/frame/layui/css/layui.css">
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/frame/static/css/styles.css">
<link rel="icon"
	href="<%=request.getContextPath()%>/frame/static/image/code.png">
</head>
<body>
	<form class="layui-form layui-form-pane" action="<%=request.getContextPath()%>/manager/mSongUpdate" method="post">
	
		<input type="hidden" value="${song.songId }" name="songId">
		<div class="layui-form-item">
			<label class="layui-form-label">歌曲名</label>

			<div class="layui-input-inline">
				<input type="text" name="songName" value="${song.songName }" lay-verify="required"
					placeholder="" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">歌手</label>

			<div class="layui-input-inline">
				<input type="text" name="singer" value="${song.singer }" lay-verify="required"
					placeholder="" autocomplete="off" class="layui-input">
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">时长</label>

			<div class="layui-input-inline">
				<input type="text" name="time" value="${song.time }" placeholder="请输入密码"
					autocomplete="off" class="layui-input">
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">歌曲路径</label>

			<div class="layui-input-block">
				<input type="text" name="src" value="${song.src }" autocomplete="off"
					placeholder="" lay-verify="required" class="layui-input">
			</div>
		</div>

		<div class="layui-form-item">
			
			<label class="layui-form-label">歌曲类型</label>
			<div class="layui-input-inline">
				<select name="typeId">
					<option value="">请选择</option>
					<option value="1" <c:if test="${song.typeId== 1}"> selected="selected"</c:if>>说唱</option>
					<option value="2" <c:if test="${song.typeId== 2}"> selected="selected"</c:if>>摇滚</option>
					<option value="3" <c:if test="${song.typeId== 3}"> selected="selected"</c:if>>流行</option>
					<option value="4" <c:if test="${song.typeId== 4}"> selected="selected"</c:if>>民谣</option>

				</select>
			</div>

		</div>
		</div>

		<!-- <div class="layui-form-item layui-form-text">
        <div class="layui-input-block">
            <textarea id="LAY_demo_editor" placeholder="请输入内容" class="layui-textarea"></textarea>
        </div>
        <label class="layui-form-label">请输入内容</label>
    </div> -->
		<div class="layui-form-item">
			<button class="layui-btn" type="submit" lay-filter="sub">提交</button>
		</div>
	</form>


	<script src="<%=request.getContextPath()%>/frame/layui/layui.js"
		charset="utf-8"></script>
	<script type="text/javascript">
		layui
				.use(
						[ 'form', 'layedit', 'laydate', 'element' ],
						function() {
							var form = layui.form, layer = layui.layer, layedit = layui.layedit, laydate = layui.laydate, element = layui.element;

							//创建一个编辑器
							var editIndex = layedit.build('LAY_demo_editor');

							//自定义验证规则
							form.verify({
								title : function(value) {
									if (value.length < 5) {
										return '标题至少得5个字符啊';
									}
								},
								pass : [ /(.+){6,12}$/, '密码必须6到12位' ],
								content : function(value) {
									layedit.sync(editIndex);
								}
							});

							//监听提交
							form.on('submit(sub)', function(data) {
								layer.alert(JSON.stringify(data.field), {
									title : '最终的提交信息'
								});
								return false;
							});

							// you code ...

						});
	</script>
</body>
</html>